using RStudio.UIFramwork;
using RStudio.UnitSingleton;


/// <Summary>
///
/// </Summary>
[UIDetail("PageUIModuleCenter", "PageUIModuleCenter")]
public class PageUIModuleCenter : UIBase
{
    public DetailPageUIModuleCenter Detail;


    public override void InitComponent()
    {
        Detail = new DetailPageUIModuleCenter(transform);


        this.Detail.BTN_Btn_ClickUIController.onClick.AddListener(() =>
        {
            GameService.Instance.GetService<ServiceUI>().UIEnter.Open<PageUIController>();
        });

        this.Detail.BTN_Btn_ClickClose.onClick.AddListener(() =>
        {
            GameService.Instance.GetService<ServiceUI>().UIEnter.Open<PageUIClose>();
        });

        this.Detail.BTN_Btn_Quit.onClick.AddListener(() =>
        {
            GameService.Instance.GetService<ServiceUI>().UIEnter.Close(this);
        });

        this.Detail.TextMeshProUGUI_Tooltip.text = $"{this.GetType().Name} | 功能详细：【关旧】{this.UseClosePrevious} 【可被关】{this.CanBeClosed}";

        this.Detail.TextMeshProUGUI_Content.text =
            "<b>核心调度方法</b>\n\n" +
            "UIModule.Instance.SendToQueue(UIEventArgs args0)\n\n" +
            "你可以通过他向UI队列添加你想要 \"打开/关闭\" 的页面\n\n" +
            "例如：\n\n" +
            "new UIEventArgs() {\n" +
            "\tType=typeof(PageEntry),\n" +
            "\tUIEventType=UIEventType.Open\n" +
            "};\n\n" +
            "因为参数的众多性, 此方法并非是最推荐的调度方法！";
    }
}
